using System;

namespace RoketSolutions.SP2010.Infrostructure.Security
{    
    public class Permission : IEquatable<Permission>
    {        
        public Permission()
        {
            Name = String.Empty;
        }
        
        public Permission(String name)
        {
            Name = name;
        }

        public String Name
        {
            get; set;
        }
        
        public bool Equals(Permission permission)
        {
            return permission != null && Equals(Name, permission.Name);
        }

        public override bool Equals(object obj)
        {
            return ReferenceEquals(this, obj) || Equals(obj as Permission);
        }

        public override int GetHashCode()
        {
            return Name != null ? Name.GetHashCode() : 0;
        }
    }
}